import http from '@/utils/http'

const baseURL = '/v1.0'

export const avatar = url => {
  return http.get(`/e-resource/api/file/avatar/${url}`)
}

/**
 * 获取省市区所对应的学校
 * @returns {AxiosPromise}
 */
export const getSchoollist = areaCodeQu => {
  return http.get(`${baseURL}/public/school/${areaCodeQu}`)
}

/**
 * 邮箱注册
 * @returns {AxiosPromise}
 */
export const EmailSent = emailuuid => {
  return http.get(`${baseURL}/public/verify/${emailuuid}`)
}

/**
 * 邮箱验证——忘记密码
 * @param {String} params - 用户名、邮箱/用户名、验证码/用户名、新密码
 */
export const EmailValidation = params => {
  return http.post(`${baseURL}/public/resetPassword`, params)
}
/**
 * 修改密码——重置密码
 *password,newPassword
 */
export const updatePassword = (password, newPassword) => {
  return http.post(`${baseURL}/private/changePwd`, password, newPassword)
}

export const getUserNum = () => {
  return http.get(`${baseURL}/public/getusernum`)
}
